//
//  AboutusViewController.m
//  werfgh
//
//  Created by 李晓勇 on 14-9-17.
//  Copyright (c) 2014年 dingshenwangluokeji. All rights reserved.
//

#import "AboutusViewController.h"
#import "Header.h"
@interface AboutusViewController ()
{
    NSArray*arry;
}
@end

@implementation AboutusViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title=@"乐乎";
        
        
    }
    return self;
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    
}
-(void)addBack
{
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(0, 0, 28, 28);
    
    [backBtn setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backItem;
    
    // Do any additional setup after loading the view.
    
}
-(void)doBack:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    [self addBack];
    self.view.backgroundColor=[UIColor colorWithRed:246.0/255 green:247.0/255 blue:248.0/255 alpha:1] ;
    self.title=@"关于我们";
    arry=@[@"电话首选理念",
         
           @"客服电话：400-829-6010"];
    
    NSLog(@"%@",arry);
    UIImageView *imageView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"114.png"]];
    imageView.frame =CGRectMake(95, 30 ,130, 130);
    UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(0, 170, 320, 40)];
    //label.text=@"网络电话首选乐乎";
    label.backgroundColor=[UIColor clearColor];
    
    label.textAlignment=1;
    label.font=[UIFont fontWithName:@"CourierNewPS-ItalicMT" size:15];
    UILabel*label2=[[UILabel alloc]initWithFrame:CGRectMake(0, 195, 320, 35)];
    //获取版本号
    label2.backgroundColor=[UIColor clearColor];
    
    label2.text=[NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];
    [[NSUserDefaults standardUserDefaults]setObject:label2.text forKey:@"Version"];
    //NSLog(@"nihao%@",[[NSUserDefaults standardUserDefaults]objectForKey:@"Version"]);
    
    label2.textAlignment=1;
    label2.font=[UIFont fontWithName:@"Arial-BoldMT" size:13];
    [self.view addSubview:imageView];
    [self.view addSubview:label];
    [self.view addSubview:label2];
    if (DeviceHeight==568) {
        for (int i=0; i<[arry count]; i++)
        {
            UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(0, 240+100*i, 320, 40)];
            label.backgroundColor=[UIColor clearColor];
            label.text=arry[i];
            label.textAlignment=1;
            label.font=[UIFont systemFontOfSize:18];
            [self.view addSubview:label];
        }
    }
    
    else
    {
        
        for (int i=0; i<[arry count]; i++)
        {
            UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(0, 230+80*i, 320, 25)];
            label.backgroundColor=[UIColor clearColor];
            label.text=arry[i];
            label.textAlignment=1;
            label.font=[UIFont systemFontOfSize:13];
            [self.view addSubview:label];
        }
        
    }
    
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
